function gid(id){return document.getElementById(id);}
function TreeNodeClick(obj)
{
	var strDisplay=obj.src.indexOf(TreeListView_Collapse)>=0 ? "none":"";
	var children=gid(obj.id.replace("img_","")).getAttributeNode("childids").nodeValue;
	if (children==""){obj.style.visibility="hidden";return;}
	var arr=children.split(",");
	for(var i=0,j=arr.length;i<j;i++)
	{
		gid(arr[i]).style.display=strDisplay;
		ExpandTreeNode(gid(arr[i]),strDisplay);
	}
	if (strDisplay=="none")
		obj.src=TreeListView_Expand;
	else
		obj.src=TreeListView_Collapse;
	var span=gid(obj.id.replace("img_","span_"));
	if (span) span.style.display=strDisplay;
}
function ExpandTreeNode(obj,mode)
{
	if(obj==null) return;
	var img=gid("img_"+obj.id)
	if(img==null) return;
	var strDisplay=img.src.indexOf(TreeListView_Collapse)>=0 ? "":"none";
	if (strDisplay=="none" && mode=="") return;
	var objchildren=gid(obj.id.replace("img_",""));
	if(objchildren==null) return;
	var children=objchildren.getAttributeNode("childids").nodeValue;
	if (children=="") return;
	var arr=children.split(",");
	for(var i=0,j=arr.length;i<j;i++)
	{
		gid(arr[i]).style.display=mode;
		ExpandTreeNode(gid(arr[i]),mode);
	}
}